﻿using MediatR;
using Reporting.API.Utils;
using Reporting.Domain;
using Reporting.Errorcode;

namespace Reporting.API.Application.Commands.SaleOrders
{
    /// <summary>
    /// 添加 销售订单
    /// </summary>
    public class AddSaleOrderCommand : IRequest<ApiResult>
    {
        /// <summary>
        /// 销售单号
        /// </summary>
        public string SalesOrderNumber { get; set; }
        /// <summary>
        /// 销售订单主题
        /// </summary>
        public string SalesOrderTheme { get; set; }
        /// <summary>
        /// 客户名称
        /// </summary>
        public string CustomerName { get; set; }
        /// <summary>
        /// 销售日期
        /// </summary>
        public DateTime SaleDate { get; set; }
        /// <summary>
        /// 出库状态
        /// </summary>
        public string OutboundStatus { get; set; }
        /// <summary>
        /// 总金额
        /// </summary>
        public decimal TotalAmount { get; set; }
        /// <summary>
        /// 已收款金额
        /// </summary>
        public decimal ReceivedAmount { get; set; }
        /// <summary>
        /// 未收款金额
        /// </summary>
        public decimal UnpaidAmount { get; set; }
        /// <summary>
        /// 已开票金额
        /// </summary>
        public decimal InvoicedAmount { get; set; }
        /// <summary>
        /// 未开票金额
        /// </summary>
        public decimal UnlicensedAmount { get; set; }
    }


    /// <summary>
    /// 显示 分页 销售订单
    /// </summary>
    public class GetSaleOrderCommand : IRequest<ApiResult<PagingResult<IList<SaleOrder>>>>
    {
        /// <summary>
        /// 当前页
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 页容量
        /// </summary>
        public int PageSize { get; set; }
    }


    /// <summary>
    /// 修改 销售订单
    /// </summary>
    public class UpdateSaleOrderCommand : IRequest<ApiResult>
    {
        /// <summary>
        /// 销售订单ID
        /// </summary>
        public int SaleOrderID { get; set; }
        /// <summary>
        /// 销售单号
        /// </summary>
        public string SalesOrderNumber { get; set; }
        /// <summary>
        /// 销售订单主题
        /// </summary>
        public string SalesOrderTheme { get; set; }
        /// <summary>
        /// 客户名称
        /// </summary>
        public string CustomerName { get; set; }
        /// <summary>
        /// 销售日期
        /// </summary>
        public DateTime SaleDate { get; set; }
        /// <summary>
        /// 出库状态
        /// </summary>
        public string OutboundStatus { get; set; }
        /// <summary>
        /// 总金额
        /// </summary>
        public decimal TotalAmount { get; set; }
        /// <summary>
        /// 已收款金额
        /// </summary>
        public decimal ReceivedAmount { get; set; }
        /// <summary>
        /// 未收款金额
        /// </summary>
        public decimal UnpaidAmount { get; set; }
        /// <summary>
        /// 已开票金额
        /// </summary>
        public decimal InvoicedAmount { get; set; }
        /// <summary>
        /// 未开票金额
        /// </summary>
        public decimal UnlicensedAmount { get; set; }
    }
    
    /// <summary>
    /// 删除 销售订单
    /// </summary>
    public class DeleteSaleOrderCommand : IRequest<ApiResult>
    {
        /// <summary>
        /// 销售订单ID
        /// </summary>
        public int SaleOrderID { get; set; }
    }


}
